﻿using Core.DataAccess.Model.Project.Information;
using Core.Framework.Model.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace Core.IBusiness.IInformation
{
    /// <summary>
    /// 信息分类
    /// </summary>
    public interface IInformationType
    {

        /// <summary>
        /// 信息分类操作
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sqlExecType"></param>
        /// <returns></returns>
        MethodResult<int> InformationTypeExec(InformationType model, SqlExecType sqlExecType);

        /// <summary>
        /// 信息分类扩展属性操作
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sqlExecType"></param>
        /// <returns></returns>
        MethodResult<int> InformationTypeAttributeExec(InformationTypeAttribute model, SqlExecType sqlExecType);


        /// <summary>
        /// 获取指定信息类型
        /// </summary>
        /// <param name="projectToken"></param>
        /// <param name="typeKey"></param>
        /// <returns></returns>
        MethodResult<InformationType> GetInformationType(int typeKey, string projectToken);

        /// <summary>
        /// 搜索分类
        /// 只搜索指定分类下级分类
        /// </summary>
        /// <param name="typeKey">管理关键字</param>
        /// <param name="search">搜索内容</param>
        /// <param name="projectToken">项目token</param>
        /// <param name="pagination"></param>
        /// <returns></returns>
        MethodResult<List<InformationType>> SearchInformationType(int typeKey, string projectToken, Pagination pagination, string search = null);


        /// <summary>
        /// 获取指定用户创建的信息类型
        /// </summary>
        /// <param name="projectToken"></param>
        /// <param name="userKey">用户ID</param>
        /// <param name="pagination"></param>
        /// <param name="typeKey">指定分类子集 默认顶级开始</param>
        /// <returns></returns>
        MethodResult<List<InformationType>> GetInformationTypeUser(int userKey, string projectToken, Pagination pagination, int typeKey = 0);


        /// <summary>
        /// 获取信息类型列表
        /// </summary>
        /// <param name="projectToken"></param>
        /// <param name="pagination"></param>
        /// <returns></returns>
        MethodResult<List<InformationType>> GetInformationTypes(string projectToken, Pagination pagination);




    }
}
